package cn.ycc1.boot3redis.entity;

import java.io.Serializable;

/**
 * 消息模型
 * @author ycc
 * @date 2025/11/20
 */
public class Message implements Serializable {
    private static final long serialVersionUID = 1L;

    private String id;
    private String content;
    private Long timestamp;
    private String type;

    // 构造函数
    public Message() {}

    public Message(String id, String content, String type) {
        this.id = id;
        this.content = content;
        this.type = type;
        this.timestamp = System.currentTimeMillis();
    }

    // getter和setter方法
    public String getId() { return id; }
    public void setId(String id) { this.id = id; }

    public String getContent() { return content; }
    public void setContent(String content) { this.content = content; }

    public Long getTimestamp() { return timestamp; }
    public void setTimestamp(Long timestamp) { this.timestamp = timestamp; }

    public String getType() { return type; }
    public void setType(String type) { this.type = type; }

    @Override
    public String toString() {
        return "Message{" +
                "id='" + id + '\'' +
                ", content='" + content + '\'' +
                ", timestamp=" + timestamp +
                ", type='" + type + '\'' +
                '}';
    }
}
